<template>
  <div class="help" :class="{ 'active': isActive }" @click="isActive = !isActive">?
    <span><slot></slot></span></div>
</template>
<script>
  export default {
    name: 'Help',
    data () {
      return {
        isActive: false
      }
    }
  }
</script>
<style lang="scss" scoped>
  .help {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.25rem;
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1.4rem;
    line-height: 1.6rem;
    color: #1CA2FF;
    border: 1px solid #1ca2ff;
    border-radius: 50%;
    text-align: center;
    position: relative;

    span {
      display: none;
      position: absolute;
      top: 2.5rem;
      right: 0;
      width: 20rem;
      font-size: 1.2rem;
      padding: 0.2em;
      background-color: #fff;
      border: 1px solid #1ca2ff;
      text-align: left;
      border-radius: 5px;
      z-index: 99;
    }

    &.active {
      span {
        display: block;
      }
    }
  }
</style>
